DialScript is distributed as FreeWare (which means that it is copyrighted by the author to retain certain rights over it). It is made available free of charge and may be distributed freely, as long as the following conditions are respected:
You may freely distribute the unmodified DialScript in both source and object format provided that you include this manual with it and that you do not charge for it. You may modify it in any way you please, but if you want to make it available thus to others, we require that you name this (your) program differently and make no references to DialScript or the author except, perhaps, in an acknowledgements section of the manual or the "About" box in the program. However, you may not sell or charge for a program that was developed based on DialScript.
DialScript is not warranted to do anything useful (it may well not for you!) and we disclaim all responsibility for any and all possible direct or indirect damages its use might cause. Use DialScript at your own risk.
In this Chapter
• Purpose of DialScript
• Instructions for Installing DialScript
• How to Use DialScript
• Acknowledgements
• Bugs and Hints
Purpose of DialScript
DialScript is intended to complement terminal emulation programs that lack a good macro capability for automatic and intelligent login. Typically, users run DialScript to set up the modem, dial a phone number and step through a login sequence for a remote computer. When the login is complete, they switch either automatically or manually to a standard terminal emulator and proceed.
DialScript is an interpreter for an extremely simple programming language roughly based on finite state automata. Statements in the language interact with the serial ports by either sending strings to them or waiting for strings from them. The language also deals with time and timeouts. Using it, you can create quite powerful scripts that can redial when the line is busy and react to errors or exceptional conditions.
Installation Instructions (This is all Apple's fault!)
If you are running system 7.0 or later, and your keyboard lacks a control key, you must drag file DialScript.Layout (without renaming it) onto your system file. This installs a keymapping resource that causes the option key to work as the control key while DialScript is running.
If you are running a system older than 7.0, you do not need to do anything special -- just run DialScript.
How to Use DialScript
When you run DialScript, a terminal window will appear. This window does not emulate any particular terminal type and is intended only to help you write scripts. Some communications parameters may be changed via the "Settings" menu. DialScript also contains a built-in editor (select either "New Edit" or "Open Edit" from the file menu). You may use this editor or any other TEXT file editor to create and view scripts. An example script that you could enter and run follows. More complex examples are distributed with DialScript, and you may find one explained in detail in the last chapter of this document.
script Example1 -- This script dials a number on a Hayes modem
state One
send "AT\r";
wait "OK";
send "ATDT3456789\r";
end;
end;
This script dials a number on a Hayes-type modem. Once it has been entered and saved, this script may be run by selecting "Run Script" from the File-menu. Press command-period to stop a running script. The DialScript language is case sensitive and contains lots of reserved words such as script and state. See the next chapter for a complete definition of the DialScript Language. The "\r" is used to represent a carriage return.
If you run a script containing a syntax error, DialScript will complain. Enable the Listing window (see the Settings-menu) and run the script again to obtain a script listing to identify the approximate location of the error.
Script files that were created by DialScript may be run by double clicking on them when DialScript is not running. This is a convenient way to run already finished scripts. Note, however, that DialScript will not automatically change the creator ID of files created by other programs, but you could use the Save As command to create a Dialscript document file or use the Kiss File feature to change a File's creator ID to DialScript.
If you wish to log the text appearing in the Terminal window to a disk file for archival or later review, use the Log File feature (in the File menu). Old log files will be overwritten if you start a new one with the same name. Also, please note the startlog and stoplog statements described in the next chapter.
Acknowledgements
DialScript is based upon TransSkel by Paul DuBois and is implemented in THINK C 5.0.x with the help of flex and bison from the GNU project. All of these packages are highly recommended. The latest version of DialScript, its source code, and all Freeware packages used are available via anonymous ftp to host rascal.ics.utexas.edu. Rascal does not have a mail server.
If you use DialScript, I'd be pleased to hear from you (to know the size of audience). Is it useful that I distribute this hack? Send me e-mail or a postcard, as might be most convenient for you.
Peter Newton
newton@cs.utk.edu
301 Cheshire Drive #148
Knoxville, TN 37919
U.S.A.
Bugs and Hints
* Has a conflict I don't understand with the CDEV ButtonKey 1.2.
* Use select and timeout instead of wait to build robust scripts.
* Don't use timeout values that are too small. Humans tend to underestimate. Time it!
* Use display to print a message when a timeout occurs -- helps in debugging scripts.
* Error messages are vague and the listing window is slow.
* You may not put null characters or 8 bit characters into strings.
* Some script errors are not caught until runtime -- undefined state and too many select conditions are examples. Duplicate script names are not caught at all. The first is used. I am lazy.
* Keys: OPTION is CONTROL, CLEAR is ESC, and SHIFT-BACKSPACE is DEL on MacPlus keyboards.
* Transfer is problematic. It works on System 6.0, but has a few problems with System 7.0. You may not refer to aliases in a transfer, and there may be problems transferring to applications that support the System 7.0 required Apple Events. MacLayers 1.2 and ZTerm 0.9.0 do not. The bottom line is try it and see if it works! I use it with MacLayers on System 7.0.
* The terminal window has no cursor.
* Does not run in the background under Multifinder. I would like it to, but it's too much of a hassle. This is Freeware, you know. Let's all bug Apple for preemptive multitasking like real computers have.
* DialScript operates with all flow control disabled. The hope is that nobody's login process involves enough text to overrun any buffers.
* I intend DialScript to work on all Macs from the 512 up, using System 4.2 or later. Does it? I don't know. During the development of DialScript I have used it on Plus, SE, SE/30, IIcx, IIsi, and a Classic under systems 6.0.x and 7.0.
* Option key remapping is always active while DialScript is running under Finder (as opposed to Multifinder). This can cause the option key to act incorrectly within desk accessories that are running with DialScript.
* Using the printer port while Appletalk is active causes a crash.
* Has USA keyboard dependencies. This problem might go away if you run System 7.0 and do NOT install the keyboard layout. This will make sense only for Macs with control keys. Please tell me if this does or does not work. I have no way to test it. For other circumstances, I believe that those who know how can hack the internal KCHR (for System 6.0.x) or the
layout file (for System 7.0) with ResEdit to resolve the keyboard dependencies. Again, please let me know.
* The trace features in the listing dialog are useless. Ignore them.
* If you use Appletalk Remote, you must turn of "Answer Calls" in order to effectively use DialScript. If you do not, the Appletalk Remote software will hang up your modem whenever the serial port is closed. Hence, you will be disconnected when you switch from DialScript to your terminal emulator. Some FAX answering software has the same problem.